package arabicScrabble;

import java.awt.Graphics;
import java.awt.LayoutManager;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

public class ImagePanel extends JPanel {

	BufferedImage img;
	public ImagePanel(String imagePath) {
	
		try {
			img = ImageIO.read(new File(imagePath));
		
		//randomPicPanel.getGraphics().drawImage(img, 0, 0, randomPicPanel.getWidth(),randomPicPanel.getHeight(), null);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	
	@Override
	public void paint(Graphics g) {
		if (img == null) 
			super.paint(g);
		 else
			g.drawImage(img, 0, 0, this.getWidth(),this.getHeight(), null);
		}
	}
	

